var CopyPlugin = require('copy-webpack-plugin');
var path = require('path');
module.exports = {
  devServer:{
    port:'8000',
    open:true,
    // proxy: {
    //   '/api': {
    //     target: 'https://api.kinxpeng.com/',//目标地址
    //     ws: true,//是否代理websocket
    //     changeOrigin: true,//是否跨域
    //     pathRewrite: {
    //       '^/api': 'https://api.kinxpeng.com/'//url重写
    //     }
    //   }
    // }
    historyApiFallback: true,
  },
  publicPath: './',
  outputDir:'blog', // 打包文件名
  productionSourceMap: false, // 去掉打包后的map文件
  configureWebpack:{
    plugins: [
      new CopyPlugin({
        patterns:[
          {
            from: 'node_modules/mavon-editor/dist/highlightjs',
            to: path.resolve(__dirname, './blog/highlightjs'), // 插件将会把文件导出于/dist/highlightjs之下
          }, 
          {
            from: 'node_modules/mavon-editor/dist/markdown',
            to: path.resolve(__dirname, './blog/markdown'), // 插件将会把文件导出于/dist/markdown之下
          },
          {
            from: 'node_modules/mavon-editor/dist/katex', // 插件将会把文件导出
            to: path.resolve(__dirname, './blog/katex')
          }
        ]
      }),
    ],
  },
  
}